import java.io.*;
import java.util.Scanner;

public class IO123{
    public static void main(String[] args) throws IOException {
        File file = new File( "Sort.txt");
        FileWriter writer = new FileWriter("A.txt");
        //.看文件创建是否发生异常
        try {
            if (!file.exists()) {
                file.createNewFile();
            }
        } catch (IOException Exception) {
            System.out.println("错误，指定的路径并不存在");
        }
        System.out.println("test" + file.exists());

        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();//将用户输入的一整行字符串赋给s
        writer.write(s);

        writer.flush();
        String[] c = s.split("\\s+");//用空格将其分割成字符串数组
        int size = c.length;
        int[] b =new int[size];





        for (int m = 0; m < b.length; m++) {

        b[m] = Integer.parseInt(c[m]);//讲字符串数组转换成int数组
        }
        int temp=0;
        for (int i = 0; i < b.length; i++) {
        for (int j = 0; j < b.length-i-1; j++) {
        if(b[j]>b[j+1]){
        temp=b[j];
        b[j]=b[j+1];
        b[j+1]=temp;
        }
        }
        }

        for(int n = 0; n < b.length ; n++){
        System.out.print(b[n]);
        System.out.print(' ');
            }

        for(int value : b)
            writer.write(value);
        sc.close();
       


        }
}
